''''''

"""
1.用文件操作创建一个 ts.txt  并且写入  天生我材必用用
2.读取文件，并且将读取的结果倒序  用用必材我生天
"""

with open('ts.txt', 'w') as file:
    file.write('天生我材必用用\n')

print('文件写入完成')

with open('ts.txt', 'w') as file:
    file.write('天生我材必用用')

print('文件写入完成')


# 读取文件内容
with open('ts.txt', 'r') as file:
    content = file.read()

# 将内容倒序
reversed_content = content[::-1]

print(reversed_content)


